const mongoose = require('../db.js');
const dayjs = require('dayjs');

//2.创建约束对象Schema(定义结构),每个Schema对应一个collection(集合)
let groupShe = new mongoose.Schema({
    groupName: {
        type: String,
        index: { unique: true }    //是否唯一,并且加索引
    },
    groupStatus: String,
    createTime: {
        type: String,
        default: dayjs().format('YYYY-MM-DD HH:mm:ss'),
        // 复合索引
        // index: { unique: false, expires: '1d' }//一天后删除数据
    },
})

module.exports = groupShe;

